package mop.exception;
public class IllegalFieldTypeException extends Throwable{
	
	/**
	 * Initializes an IllegalFieldException with given type
	 * 
	 * @param type	Field type that gave error
	 * @param id	The field identifier
	 * @post	Set the type
	 * @post	Set the identifier
	 */
	public IllegalFieldTypeException(String type,String id)
	{
		this.type = type;
		this.id = id;
	}
	
	
	/**
	 * Return a error message that can be used by the gui
	 * @return An error message describing the incorrect type
	 */
	public String toString()
	{
		
		StringBuffer sb = new StringBuffer();
		sb.append("The following field type does not exist! :");
		sb.append("Field type :"+type+" for field with identifier: "+id);
		
		return sb.toString();
		
	}
	 
	/**
	 * Weird java demand
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * The type thats causing the problem
	 */
	private final String type;
	
	/**
	 * The id that's causing the problem
	 */
	private final String  id;
	

}
